package com.wind.cloud.zero.feign.fallback;

import java.util.List;

import org.springframework.stereotype.Component;

import com.wind.cloud.zero.domain.User;
import com.wind.cloud.zero.feign.RemoteUserService;

import feign.hystrix.FallbackFactory;

@Component
public class RemoteUserFacllbackFactory implements FallbackFactory<RemoteUserService>
{
    @Override
    public RemoteUserService create(Throwable throwable)
    {
        return new RemoteUserService()
        {
            @Override
            public User get(Integer id)
            {
                return null;// 注意这里故意区分之前的返回内容，返回null
            }

            @Override
            public List<User> list()
            {
                return null;
            }
        };
    }
}
